package com.dhcc.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.dhcc.config.response.ResponseResult;
import com.dhcc.config.sign.Signature;
import com.dhcc.entity.User;

@RestController
@RequestMapping("/user")
public class SignTestController {

    @Signature
    @PostMapping("/test1")
    public ResponseResult<String> myController(@RequestBody User user) {
        return ResponseResult.success(String.join(",", user.toString()));
    }

    
    @Signature
    @PostMapping("/test1/{id}")
    public ResponseResult<String> myController1(@PathVariable String id) {
        return ResponseResult.success(String.join(",", id));
    }

    @Signature
    @GetMapping("/test2")
    public ResponseResult<String> myController2(@RequestParam String client) {
        return ResponseResult.success(String.join(",", client));
    }

}
